package com.library.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;

@ApiModel(description = "书籍信息")
public class Book {

    @ApiModelProperty(value = "书籍ID", example = "1")
    private int bookId;

    @ApiModelProperty(value = "书籍名称", example = "Java编程思想", required = true)
    private String bookName;

    @ApiModelProperty(value = "作者", example = "Bruce Eckel", required = true)
    private String bookWriter;

    @ApiModelProperty(value = "书籍类型", example = "计算机科学", required = true)
    private String bookType;

    @ApiModelProperty(value = "书籍价格", example = "89.00", required = true)
    private double bookPrice;

    @ApiModelProperty(value = "出版日期", example = "2020-01-01", required = true)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date pubDate;

    @ApiModelProperty(value = "书籍封面路径", example = "/images/java_book.jpg")
    private String bookCover;

    public String getBookCover() {
        return bookCover;
    }

    public void setBookCover(String bookCover) {
        this.bookCover = bookCover;
    }

    public int getBookId() {
        return bookId;
    }

    public void setBookId(int bookId) {
        this.bookId = bookId;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getBookWriter() {
        return bookWriter;
    }

    public void setBookWriter(String bookWriter) {
        this.bookWriter = bookWriter;
    }

    public String getBookType() {
        return bookType;
    }

    public void setBookType(String bookType) {
        this.bookType = bookType;
    }

    public double getBookPrice() {
        return bookPrice;
    }

    public void setBookPrice(double bookPrice) {
        this.bookPrice = bookPrice;
    }

    public Date getPubDate() {
        return pubDate;
    }

    public void setPubDate(Date pubDate) {
        this.pubDate = pubDate;
    }

    public Book() {
    }

    @Override
    public String toString() {
        return "Book{" +
                "bookId=" + bookId +
                ", bookName='" + bookName + '\'' +
                ", bookWriter='" + bookWriter + '\'' +
                ", bookType='" + bookType + '\'' +
                ", bookPrice=" + bookPrice +
                ", pubDate=" + pubDate +
                '}';
    }
}
